package com.ruoyi.common.enums.map;

import org.jetbrains.annotations.NotNull;
import java.util.HashMap;
import java.util.Map;

public class BaseData {

    public static Map<String, String> userTypeArr = new HashMap<>();
    public static Map<String, String> courseGradeArr = new HashMap<>();
    public static Map<String, String> userIdentityArr = new HashMap<>();
    public static Map<String, String> courseTypeArr = new HashMap<>();
    public static Map<String, String> noteTypeArr = new HashMap<>();
    public static Map<String, String> activitySpaceTypeArr = new HashMap<>();
    public static Map<String, String> articleTypeArr = new HashMap<>();

    static {
    // ---------------------课程新增时用户类型----------------------------------------------------------
    userTypeArr.put("user", "用户");
    userTypeArr.put("pharmacy", "中医馆");

    // ---------------------课程等级类型---------------------------------------------------------------
    courseGradeArr.put("primary", "入门");
    courseGradeArr.put("initial", "初级");
    courseGradeArr.put("advanced", "高级");
    courseGradeArr.put("intermediate", "中级");

    // ---------------------用户信息新增个人身份---------------------------------------------------------
    userIdentityArr.put("athlete", "中医爱好者");
    userIdentityArr.put("doctor", "中医从业者");
    userIdentityArr.put("student", "中医专业学生");
    userIdentityArr.put("western", "西学中");
    userIdentityArr.put("visitor", "游客");

    // ---------------------课程类型-------------------------------------------------------------------
    courseTypeArr.put("audio", "音频");
    courseTypeArr.put("video", "视频");

    // ---------------------笔记类型-------------------------------------------------------------------
    noteTypeArr.put("video", "视频");
    noteTypeArr.put("book", "书籍");

    // ---------------------活动-空间中间表类型----------------------------------------------------------
    activitySpaceTypeArr.put("(course", "课程");
    activitySpaceTypeArr.put("book", "书籍");
    activitySpaceTypeArr.put("paper", "试题");
    activitySpaceTypeArr.put("user", "用户");

    // ---------------------文章分类类型---------------------------------------------------------------
        articleTypeArr.put("newsflash", "伊芦快讯");
        articleTypeArr.put("willKnow", "小白必知");
        articleTypeArr.put("advanced", "succinct");
    }

    // 获取用户等级并转换为前端需要的格式
//    TODO 目前缺少试题表，订单表和收藏未建表
    public String getUserGradeForFrontend(@NotNull String str,@NotNull String s) {
        switch (str){
            case "userTypeArr":
                return userTypeArr.getOrDefault(s,"未知等级");
            case "courseGradeArr":
                return courseGradeArr.getOrDefault(s,"未知等级");
                case "userIdentityArr":
                    return userIdentityArr.getOrDefault(s,"未知等级");
                case "courseTypeArr":
                    return courseTypeArr.getOrDefault(s,"未知等级");
                case "noteTypeArr":
                    return noteTypeArr.getOrDefault(s,"未知等级");
                case "activitySpaceTypeArr":
                    return activitySpaceTypeArr.getOrDefault(s,"未知等级");
                case "articleTypeArr":
                    return articleTypeArr.getOrDefault(s,"未知等级");
            default: return "未知类型";
        }

    }

}
